package com.southminority.ethnic.service.redis;


import java.util.concurrent.TimeUnit;

public interface RedisService {
    /**
     * redis 存储键值对
     * @param key
     * @param value
     * @param expireTime
     * @param unit
     * @return
     */
    Boolean redisSetValue(String key, String value, Long expireTime, TimeUnit unit);

    String redisGetValue(String key);

    Long redisGetExpireTime(String key,TimeUnit unit);

    /**
     * 删除Redis中的键
     * @param key
     * @return
     */
    Boolean redisDelete(String key);

    /**
     * 为已存在的键设置过期时间
     */
    Boolean expire(String key, long timeout, TimeUnit unit);

}
